﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Fluent">
  <Style x:Key="{x:Type Controls:StatusBar}" TargetType="{x:Type Controls:StatusBar}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Height" Value="22"/>
    <Setter Property="Template" >
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Controls:StatusBar}">
          <Border BorderThickness="0,1" BorderBrush="{DynamicResource StatusBarBorderBrushBrush}">
            <Border Height="Auto" BorderThickness="0,1" BorderBrush="{DynamicResource StatusBarInnerBorderBrush}" Background="{DynamicResource StatusBarInnerBackgroundBrush}">
              <Controls:StatusBarPanel IsItemsHost="True" x:Name="itemsPresenter" Height="Auto" Margin="0"/>
            </Border>
          </Border>
        	<ControlTemplate.Triggers>
        		<Trigger Property="IsWindowMaximized" Value="False">
        			<Setter Property="Margin" TargetName="itemsPresenter" Value="0,0,16,0"/>
        		</Trigger>
        	</ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type Controls:StatusBarItem}" TargetType="{x:Type Controls:StatusBarItem}">
	<Style.Triggers>
		<Trigger Property="IsEnabled" Value="False">
			<Setter Property="Foreground" Value="#FF888888"/>
		</Trigger>
	</Style.Triggers>
  <Setter Property="OverridesDefaultStyle" Value="True"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type Controls:StatusBarItem}">
        <ContentPresenter Margin="3,0,3,0"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
<!--Menu Item Style-->
	<Style TargetType="{x:Type Controls:StatusBarMenuItem}">
		<Setter Property="Template" Value="{DynamicResource RibbonStatusBarContextMenuItemControlTemplate}"/>
		<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}"/>
		<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}"/>
		<Setter Property="Foreground" Value="{DynamicResource DefaultFontBrush}"/>
		<Setter Property="IsCheckable" Value="True"/>
		<Setter Property="IsChecked" Value="{Binding StatusBarItem.IsChecked, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
	</Style>

  <!--Menu Item Template-->
	<ControlTemplate x:Key="RibbonStatusBarContextMenuItemControlTemplate" TargetType="{x:Type Controls:StatusBarMenuItem}">
		<Grid Width="Auto" Height="22" Background="#00000000">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="25"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>
			<Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{DynamicResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{DynamicResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
				<Border Background="{DynamicResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{DynamicResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1"/>
			</Border>
			<TextBlock x:Name="textBlock_Copy" Text="{Binding StatusBarItem.Title, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,30,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left"/>
			<TextBlock x:Name="textBlock" Text="{Binding StatusBarItem.Title, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="CharacterEllipsis"/>
			<Rectangle x:Name="rectangle" Fill="{DynamicResource MenuItemCheckBoxBackgroundBrush}" Stroke="{DynamicResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Height="20" RadiusX="1" RadiusY="1" Visibility="Collapsed" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
			<Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
			<Image x:Name="iconImage" HorizontalAlignment="Center" Margin="3,2,2,2" VerticalAlignment="Center" Width="Auto" Source="{TemplateBinding Icon}" SnapsToDevicePixels="True"/>
			<TextBlock Text="{Binding StatusBarItem.Value, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="3" TextTrimming="CharacterEllipsis"/>
			<Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,4,0" Width="4" Data="M0,0L1,1 0,2z" Height="6" Grid.Column="3">
				<Path.Fill>
					<LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
						<GradientStop Color="Black" Offset="1"/>
						<GradientStop Color="#FF828282"/>
					</LinearGradientBrush>
				</Path.Fill>
			</Path>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsChecked" Value="True">
				<Setter Property="Visibility" TargetName="rectangle" Value="Visible"/>
			</Trigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="Icon" Value="{x:Null}"/>
					<Condition Property="IsChecked" Value="True"/>
				</MultiTrigger.Conditions>
				<Setter Property="Visibility" TargetName="image" Value="Visible"/>
			</MultiTrigger>
			<Trigger Property="HasItems" Value="False">
				<Setter Property="Visibility" TargetName="path" Value="Collapsed"/>
			</Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True"/>
          <Condition Property="IsEnabled" Value="True"/>
        </MultiTrigger.Conditions>        
				<Setter Property="Visibility" TargetName="border" Value="Visible"/>
      </MultiTrigger>
      <!--<Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5"/>
        <Setter Property="Opacity" TargetName="image" Value="0.5"/>
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5"/>
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect/>
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect/>
          </Setter.Value>
        </Setter>
      </Trigger>-->
		</ControlTemplate.Triggers>
	</ControlTemplate>
</ResourceDictionary>